package com.share.common.model.excel;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *  
 *  * @description      
 *  * @author chh     
 *  * @date   2019/8/3 18:16  
 *  
 */
@Data
public class ExcModel {
    private Integer sort;
    private String methodName;
    private String columnName;
    private Class filedClass;
    private String regFormat;
    private SimpleDateFormat sdf;
    private Boolean enBlank;

    public ExcModel() {
    }

    public ExcModel(Integer sort, String methodName, String columnName, Class filedClass, String regFormat, Boolean enBlank) {
        this.sort = sort;
        this.methodName = methodName;
        this.columnName = columnName;
        this.filedClass = filedClass;
        this.regFormat = regFormat;
        this.enBlank = enBlank;
        if (StringUtils.isNotBlank(regFormat) && filedClass != null && Date.class == filedClass) {
            this.sdf = new SimpleDateFormat(regFormat);
        }
    }
}
